package com.dotflat.satistics.repository.crm;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Describle 预算统计
 * @Author ZengMin
 * @Date 2018/10/10 11:52
 */
public interface BudgetRepository {

    Double findActualFeeByMonthAndAreaId(String time, String id);

    Double findPlanFeeByMonthAndAreaId(String time, String id);

    Double findFeeByParentIdAndTypeAndMonthAndArea(int feeType, int leadsType, String time, String areaId);

    //根据类型查询 总金额   所有园区
    List<Map<String, Object>> getAllBudGetByParentId(String month, Integer parentId,String areaIds,Integer timeType);
    //根据类型查询 实际 总金额   所有园区
    List<Map<String, Object>> getAllBudGetRealByParentId(String month, Integer parentId,String areaIds,Integer timeType);

    Object getAllBudGetRealByArea(String month, Integer parentId, String areaIds, Integer timeType);

    //成本构成 所有园区
    List<Map<String, Object>> getSumBudGetSingle(String month,String areaId);

    Double findFeeByMonthAndAreaIdAndParentIdAndType(String time, String areaId,Integer parentId,Integer type);

    Double findActualRunCostFeeByMonthAndAreaIdAndParentId(String time, String id, int runTypeFee);


    Object checkBudGet(String month, String areaId, Integer type,String templeteId);

    List<Map<String,Object>> getAllDischs(String areaIds,Integer parentId);

    //查询渠道总额
    List<Map<String, Object>> getAllDitchSum(String month, Integer parentId,String areaIds,Integer timeType,String templeteId);

    //查询渠道总额 单园区
    Object getAllDitchSumByArea(Date begin,Date end, Integer parentId,String areaId,Integer timeType,String templeteId);

    //根据parentId查询总额 单园区
    Object getAllDitchSumByParentId(Date begin,Date end, Integer parentId,String areaId,Integer timeType);

    //查询Leads到店数
    List<Map<String, Object>> getLeadsArriveSum(Date begin,Date end,String areaIds, String templeteId);

    //查询Leads到店数 单园区
    List<Map<String, Object>> getLeadsArriveSumByArea(Date begin,Date end,String areaId, String templeteId);

    //查询Leads到店数 单园区 数量
    Long getLeadsArriveSumCountByArea(Date begin,Date end,String areaId, String templeteId);

    //查询Leads成交数
    Object getLeadsFinishCount(Date begin,Date end,String areaId,int dayUnit,String templeteId);

    List<Map<String, Object>> getLeadsFinishCountByDate(Date begin,Date end,String areaId,int dayUnit,String templeteId);
}
